package com.damon.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;

/**
 * 
 * 环境变量配置
 * @author  wangshoufa 
 * @date 2018年11月7日 下午3:51:13
 *
 */
@RefreshScope
@Component
public class EnvironmentConfig {
	
	/**
	 * 前缀
	 */
	@Value("${remote.prefix}")
	private String prefix;
	
	/**
	 * 单位:s
	 */
	@Value("${remote.expireSeconds}")
	private Integer expireSeconds;

	/**
	 * redis的ip
	 */
	@Value("${spring.redis.host}")
    private String host;

    /**
     * redis端口号
     */
    @Value("${spring.redis.port}")
    private Integer port;

    /**
     * redis密码
     */
    @Value("${spring.redis.password}")
    private String password;

    /**
     * redis连接超时时间
     */
    @Value("${spring.redis.timeout}")
    private Integer timeout;

    /**
     * redis连接池中的最大空闲连接
     */
    @Value("${spring.redis.pool.max-idle}")
    private Integer maxIdle;

    /**
     * 连接池最大阻塞等待时间（使用负值表示没有限制）
     */
    @Value("${spring.redis.pool.max-wait}")
    private Long maxWaitMillis;

    /**
     * 调用文件中心url
     */
	@Value("${remote.pai.file.center.url}")
	private String fileCenterUrl;

	/**
	 * 文件路径前缀
	 */
	@Value("${projectPath}")
    private String projectPath;
	
	/**
	 * 数据库驱动名称
	 */
	@Value("${jdbc.driverClassName}")
	private String jdbcDriverClassName;

	/**
	 * 数据库url
	 */
	@Value("${jdbc.url}")
	private String jdbcUrl;

	/**
	 * 数据库用户名
	 */
	@Value("${jdbc.username}")
	private String jdbcUsername;

	/**
	 * 数据库密码
	 */
	@Value("${jdbc.password}")
	private String jdbcPassword;

	public String getPrefix() {
		return prefix;
	}

	public void setPrefix(String prefix) {
		this.prefix = prefix;
	}

	public Integer getExpireSeconds() {
		return expireSeconds;
	}

	public void setExpireSeconds(Integer expireSeconds) {
		this.expireSeconds = expireSeconds;
	}

	public String getHost() {
		return host;
	}

	public void setHost(String host) {
		this.host = host;
	}

	public Integer getPort() {
		return port;
	}

	public void setPort(Integer port) {
		this.port = port;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Integer getTimeout() {
		return timeout;
	}

	public void setTimeout(Integer timeout) {
		this.timeout = timeout;
	}

	public Integer getMaxIdle() {
		return maxIdle;
	}

	public void setMaxIdle(Integer maxIdle) {
		this.maxIdle = maxIdle;
	}

	public Long getMaxWaitMillis() {
		return maxWaitMillis;
	}

	public void setMaxWaitMillis(Long maxWaitMillis) {
		this.maxWaitMillis = maxWaitMillis;
	}

	public String getFileCenterUrl() {
		return fileCenterUrl;
	}

	public void setFileCenterUrl(String fileCenterUrl) {
		this.fileCenterUrl = fileCenterUrl;
	}

	public String getProjectPath() {
		return projectPath;
	}

	public void setProjectPath(String projectPath) {
		this.projectPath = projectPath;
	}

	public String getJdbcDriverClassName() {
		return jdbcDriverClassName;
	}

	public void setJdbcDriverClassName(String jdbcDriverClassName) {
		this.jdbcDriverClassName = jdbcDriverClassName;
	}

	public String getJdbcUrl() {
		return jdbcUrl;
	}

	public void setJdbcUrl(String jdbcUrl) {
		this.jdbcUrl = jdbcUrl;
	}

	public String getJdbcUsername() {
		return jdbcUsername;
	}

	public void setJdbcUsername(String jdbcUsername) {
		this.jdbcUsername = jdbcUsername;
	}

	public String getJdbcPassword() {
		return jdbcPassword;
	}

	public void setJdbcPassword(String jdbcPassword) {
		this.jdbcPassword = jdbcPassword;
	}

}
